package com.kun.service_statistics.controller;


import com.kun.service_statistics.service.StatisticsDailyService;
import com.kun.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-11-24
 */
@RestController
@CrossOrigin
@RequestMapping("/service_statistics/statistics-daily")
public class StatisticsDailyController {
    @Autowired
    private StatisticsDailyService statisticsDailyService;


    //统计某一天的注册人数
    @PostMapping("registerCount/{day}")
//    @Scheduled(cron = "0 0 0 1 * ? *")
    public R registerCount(@PathVariable String day){
        System.out.println("123");
        statisticsDailyService.registerCount(day);
        return R.ok();
    }
    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,@PathVariable String begin,@PathVariable String end){
       Map<String,Object> map = statisticsDailyService.getshowData(type,begin,end);
        return R.ok().data("map",map);
    }
}

